<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>



    <script>

        // 一般我们使用fori循环遍历数组
        // 一般使用foreach循环遍历对象

        var  array = ["zs", "ls", "wu", "zl"]
        for (var i = 0; i < array.length; i++) {
            console.log(array[i])
        }
        // for (  item in array){
        //     console.log(item + "---" + array[item])
        // }

        var user = {
            name: "zs",
            age: 18,
            address : "武汉"
        }

        for(item in user){
            console.log(item+ "---" + user[item])
        }



    </script>
</body>
</html>
